﻿#pragma once
#include "KvDataProvider.h"

class KvData;

// 采样数据provider
class KcPvData : public KvDataProvider
{
public:

	KcPvData(const QString& name, std::shared_ptr<KvData> data);

	bool isStream() const final { return false; }

	kIndex dim() const final;

	kIndex channels() const final;

	kRange range(kIndex axis) const final;

	kReal step(kIndex axis) const final;

	kIndex size(kIndex axis) const final;

	bool isRunning() const override;

	// 对于连续数据，改写range属性为可编辑
	kPropertySet propertySet() const override;

	void setOption(KeObjectOption opt, bool on) override;

	bool getOption(KeObjectOption opt) const override;

	auto data() { return data_; }
	
	void setPropertyImpl_(int id, const QVariant& newVal) override;

private:
	std::shared_ptr<KvData> data_;
};
